//
//  RHLocalSettingModel.h
//  RuiHeAppApp
//
//  Created by Yan Chen on 2024/4/9.
//

#import <Foundation/Foundation.h>
#import "RHLocalSettingOptionModel.h"

NS_ASSUME_NONNULL_BEGIN

@interface RHLocalSettingModel : NSObject
@property (nonatomic ,copy) NSArray *keys;

@property (nonatomic ,copy) NSDictionary *data;
//组数据(外层)
@property (nonatomic ,copy) NSArray<RHLocalSettingModel *> *dataList;
//行数据(内层)
@property (nonatomic ,copy) NSArray<RHLocalSettingModel *> *properList;
//json文件里的行数据
@property (nonatomic ,strong) id properties;
//枚举值
@property (nonatomic ,copy) NSArray *enums;
//枚举展示值
@property (nonatomic ,copy) NSArray *enumNames;
//枚举选项
@property (nonatomic ,copy) NSArray<RHLocalSettingOptionModel *> *selectList;

@property (nonatomic ,copy) NSString *nickname;
//值
@property (nonatomic ,copy) NSString *content;
//注释
@property (nonatomic ,copy) NSString *comment;
//字段
@property (nonatomic ,copy) NSString *field;
//参数类型
@property (nonatomic ,copy) NSString *type;
//有无符号
@property (nonatomic ,copy) NSString *dataType;
//数据格式
@property (nonatomic ,copy) NSString *format;
//最大值
@property (nonatomic ,copy) NSString *max;
//最小值
@property (nonatomic ,copy) NSString *min;
//最大长度(文本输入,密码输入)
@property (nonatomic ,assign) NSInteger maxLength;
//最小长度
@property (nonatomic ,assign) NSInteger minLength;
//步进
@property (nonatomic ,copy) NSString *unitLen;
//比例  比例是1的不要赋值此字段
@property (nonatomic ,copy) NSString *ratio;
//单位
@property (nonatomic ,copy) NSString *unit;

@property (nonatomic ,assign,getter = isReadOnly) BOOL readOnly;

@property (nonatomic ,assign,getter = isWriteOnly) BOOL writeOnly;
//寄存器地址
@property (nonatomic ,assign) NSInteger regAddr;
//位偏移量
@property (nonatomic ,assign) NSInteger offset;
//位宽
@property (nonatomic ,assign) NSInteger bitWidth;
//是否位数据
@property (nonatomic ,assign) BOOL isBit;

//原始值,用于处理位变量 ,修改位变量后要与上原来的值,这样才不改变其他位变量的值
//用于时间校准
@property (nonatomic, assign) NSInteger originalValue;

//指令的设备地址,也就是端点类型  EMS,MASTER,PACK.... 这里是LocalSettingType的类型
//有个别地方需要用到
@property (nonatomic ,copy)  NSString *cmdType;
//读取寄存器的个数,适用于读取电芯个数以及其他连续的寄存器地址
@property (nonatomic ,assign) NSInteger readAddrCount;
@end

NS_ASSUME_NONNULL_END
